#include <stdio.h>
#include "loader.h"

namespace nickel
{
	namespace core
	{
		Loader g_Loader;
		IServerGameDLL *server = NULL;

		PLUGIN_EXPOSE(Loader, g_Loader);

		bool Loader::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)
		{
			PLUGIN_SAVEVARS();

			/* Make sure we build on MM:S 1.4 */
#if defined METAMOD_PLAPI_VERSION
			GET_V_IFACE_ANY(GetServerFactory, server, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
#else
			GET_V_IFACE_ANY(serverFactory, server, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL);
#endif

			/*ScriptManager scriptManager;
			scriptManager.RunScript();*/	
	
			return true;
		}

		bool Loader::Unload(char *error, size_t maxlen)
		{

			return true;
		}

		void Loader::AllPluginsLoaded()
		{
		}

		bool Loader::Pause(char *error, size_t maxlen)
		{
			return true;
		}

		bool Loader::Unpause(char *error, size_t maxlen)
		{
			return true;
		}

		const char *Loader::GetLicense()
		{
			return "GNU GPL v3";
		}

		const char *Loader::GetVersion()
		{
			return "0.0.1";
		}

		const char *Loader::GetDate()
		{
			return __DATE__;
		}

		const char *Loader::GetLogTag()
		{
			return "NICKEL";
		}

		const char *Loader::GetAuthor()
		{
			return "Alon Gubkin";
		}

		const char *Loader::GetDescription()
		{
			return "A JavaScript plugin environment for the Source Engine";
		}

		const char *Loader::GetName()
		{
			return "Nickel";
		}

		const char *Loader::GetURL()
		{
			return "http://www.sourcejs.com/";
		}
	}
}